package com.substanceofcode.data.midp;

import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Display;

import net.sf.microlog.core.Logger;
import net.sf.microlog.core.LoggerFactory;

import junitj2me.framework.TestCase;

public class RsfsFormatTest extends TestCase
{
    private final static Logger LOG = LoggerFactory.getLogger();

    public void test1()
    {
        try
        {
            int numberRecordStores = FileSystemImpl.getFileSystem().formatFileSystem();

            LOG.info( "RsfsFormatTest test1 FileSystem.format numberRecordStores: " + numberRecordStores );

            assertTrue( "minimum numberRecordStores 1", numberRecordStores >= 1 );

            Alert alert = new Alert( "RsfsFormatTest", "numberRecordStores: " + numberRecordStores, null, AlertType.INFO );
            alert.setTimeout( 3 * 1000 );
            Display display = Display.getDisplay( RsfsMIDletTest.iMIDletInstance );
            display.setCurrent( alert, display.getCurrent() );
        }
        catch( Exception e )
        {
            fail( e.getMessage() );
        }
    }

    protected int getNumberOfImplementedTestMethods()
    {
        return 1;
    }
}
